import random


class Card:
    """
    一套扑克牌去除大小王之后的52张扑克牌中的一张
    """
    # 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < J < Q < K < A = 13 [0,12]
    values = [str(i) for i in range(2, 11)] + ["J", "Q", "K", "A"]
    # "梅花" < "方片" < "红桃" < "黑桃" = 4 [0,3]
    suits = ["梅花", "方片", "红桃","黑桃"]

    def __init__(self, value, suit):
        """
        :param value: int 13个数值 [0-12]
        :param suit:  int 4个花色  [0-3]
        """
        self.value = value
        self.suit = suit

    def __repr__(self):
        return "<{0}{1}>".format(self.suits[self.suit], self.values[self.value])

    def __gt__(self, other):
        if self.value > other.value:
            return True
        if self.value == other.value:
            if self.suit > other.suit:
                return True
            else:
                return False
        return False

    def __lt__(self, other):
        if self.value < other.value:
            return True
        if self.value == other.value:
            if self.suit < other.suit:
                return True
            else:
                return False
        return False


def shuffle(card):
    random.shuffle(card)
